package com.A21.GuoSai.demo.service_entity.entity.workflowInstance;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;


@Data
@ToString
@NoArgsConstructor
public class WorkFlowInstance {
    private Integer flowId;
    private Date starttime;
    private Date endtime;
//    @EnumValue
    private WorkFlowInstanceStatus status;
    private String message;

    public WorkFlowInstance(Integer flowId, Date starttime) {
        this.flowId = flowId;
        this.starttime = starttime;
    }

    public void setStatus(Integer integer) {
        switch (integer){
            case 1 :this.status=WorkFlowInstanceStatus.True;break;
            case 2 :this.status=WorkFlowInstanceStatus.Fail;break;
            case 3 :this.status=WorkFlowInstanceStatus.Over;break;
            default:this.status = WorkFlowInstanceStatus.Wrong;
        }
    }
}
